package com.darren.archive.entity;

import com.darren.framework.entity.BaseEntity;
import com.darren.framework.utils.Constant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.ResultCheckStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * 角色和功能关联实体
 */
@ApiModel(value = "角色和功能关联")
@Entity
@Table(name = Constant.TABLE_NAME_PREV + "user_role")
@SQLDelete(sql = "update " + Constant.TABLE_NAME_PREV + "user_role set is_delete = true,version=version+1 where id=? and version=?", check = ResultCheckStyle.COUNT)
@Where(clause = " is_delete  = false ")
public class SysUserRole extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 2606361876019189988L;

    /**
     * 用户id
     */
    @ApiModelProperty(notes = "用户id")
    @Column(name = "user_id", columnDefinition = "bigint not null comment '用户id'")
    private Long userId;

    /**
     * 角色id
     */
    @ApiModelProperty(notes = "角色id")
    @Column(name = "role_id", columnDefinition = "bigint not null comment '角色id'")
    private Long roleId;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }


}